// 用户模块
const userModule = {
  namespaced: true,
  state () {
    return {
      token: '',
      refreshToken: '',
      // 用户信息
      userObj: {}
    }
  },
  mutations: {
    setToken (state, tokenStr) {
      state.token = tokenStr
    },
    setRefreshToken (state, refreshTokenStr) {
      state.refreshToken = refreshTokenStr
    },
    setUser (state, obj) {
      state.userObj = {
        ...state.userObj,
        ...obj
      }
    }
  }
}

export default userModule
